<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/html">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="Modern UI CSS">
    <meta name="author" content="Sergey Pimenov">
    <meta name="keywords" content="windows 8, modern style, modern ui, style, modern, css, framework">

    <link href="css/modern.css" rel="stylesheet">
    <link href="css/site.css" rel="stylesheet" type="text/css">
    <link href="js/google-code-prettify/prettify.css" rel="stylesheet" type="text/css">

    <script src="js/jquery-1.8.2.min.js"></script>
    <script src="js/google-analytics.js"></script>
    <script src="js/github.info.js"></script>
    <script src="js/google-code-prettify/prettify.js"></script>
    <script src="js/pagecontrol.js"></script>

    <title>Ajax</title>
    
	<script src="http://code.jquery.com/jquery-latest.min.js"></script>
	<script>
		setInterval(getResult(),1000);

		$(document).ready(function update() 
	    {    
			

	        function getResult()
	        {                                        
	            $form = $(this);                                                        
	            $.post($form.attr('action'), $form.serialize(), function(responseText) 
	            { 
	                $('#result').text(responseText);                                     
	            });
	            return false;                                                            
	        }); 
			
	    });

	</script>
    
</head>

<body class="modern-ui" onload="prettyPrint()">
    <div class="page secondary">

        <div class="page-header">
            <div class="page-header-content">
                <h1>Ajax12</h1>
                <a href="index_loggedin.jsp" class="back-button big page-back"></a>
            </div>
        </div>
		
        <div class="page-region">
            
            <div class="page-region-content">
        		<br>
        		<br>
        		<form id="calculator" action="ajax" method="post">
				    <p>
				        <input name="left">
				        <input name="right">
				        <input type="submit" value="add">
				    </p>
				    <p>Result: <span id="result">${sum}</span></p>
				</form>
            	
            </div>
        
        </div>
   	</div>
				
</body>
</html>